<%@ page import="com.java.service.*,java.util.*,com.java.model.UserSession,com.java.util.*" %><%
response.setContentType("text/xml;charset=utf-8");

UserSession usersession = (UserSession)session.getAttribute("user");
String ent_id 			= (String)session.getAttribute("ent_id");

String connGroup 	= "";
String user_id 		= "";
if(usersession!=null){
	connGroup 	= CmmUtil.nvl(usersession.getConnGroup(),"0");
	user_id 	= CmmUtil.nvl(usersession.getUser_id(),"");
}

HashMap map = new HashMap();
HashMap map1 = null;

ArrayList list = new ArrayList();
CommonDaoService commonservice = new CommonDaoService("ComCateListDao");


String temp = request.getParameter("s_key");
String[] param = null;

if (temp.indexOf("|") > 0){	
	param = new String[3];
	param[0]=temp.substring(0,temp.indexOf("|"));
	param[1]=temp.substring(temp.indexOf("|")+1,temp.length());
	param[2]=ent_id;
	System.out.println(":"+param[0]+":");
	System.out.println(":"+param[1]+":");
	
	
	map.put("cate_id",param[0]);
	map.put("cate_gubun",param[1]);
	map.put("ent_id",param[2]);
	
	list = (ArrayList)commonservice.commonDaoMethod(map);
}else{
	map.put("cate_id","");
	map.put("cate_gubun","");
	map.put("ent_id",ent_id);
	
	list = (ArrayList)commonservice.commonDaoMethod(map);
}

StringBuffer sb = new StringBuffer(1024);

sb.append("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<content><![CDATA[");


for (int i = 0; i < list.size(); i++) {
	map = (HashMap)list.get(i);
    System.out.println((String)map.get("cd")+"||"+(String)map.get("cd_nm"));
    sb.append((String)map.get("cd"));
	sb.append("||");
    sb.append((String)map.get("cd_nm"));		    
	sb.append("$$");
}  


sb.append("]]></content>");
out.println(sb.toString());

%>
